<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>欢迎点餐</title>
	<style type="text/css">
		table { border-collapse:collapse; border:solid 1px black; }
        table th, table td { height:20px; border:solid 1px Black; padding: 10px; }
        td img { height: 100px; }
	</style>
</head>
<body>

	<form style="float:right;" action="home/search.action" method="post">
		<select name="dtype">
			<c:forEach items="${ dishTypes }" var="t">
				<option value="${ t.dishTypeNum }" ${ param.dtype eq t.dishTypeNum ? "selected=\"selected\"" : "" }>${ t.dishTypeName }</option>
			</c:forEach>
		</select>
		<input type="text" placeholder="输入店名或菜名" name="keyword" value="${ param.keyword }" />
		<input type="submit" value="搜索"/>
	</form>

	<table>
		<thead>
			<tr>
				<th>预览</th>
				<th>店家</th>
				<th>地址</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${ merchants }" var="m">
				<tr>
					<td><img src="../local/${ m.mHeadImg }"/></td>
					<td><a href="dishes?mid=${ m.mId }">${ m.mName }</a></td>
					<td>${ m.mAddr }</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>

</body>
</html>